home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gnome / help / system-admin-guide / C / themes.xml < prev   
Encoding:
Text File  |  2009-04-10  |  16.9 KB  |  387 lines

  1. <chapter id="themes-0">
  2.   <title>Installing Themes</title>
  3.   <highlights>
  4.     <para>This chapter describes themes, the theme settings that are
  5. available in the GNOME Desktop, how to install options for theme settings,
  6. and how to create a custom option.</para>
  7.   </highlights>
  8.   <sect1 id="themes-1">
  9.     <title>Introduction to Themes</title>
  10.     <indexterm>
  11.       <primary>themes</primary>
  12.       <secondary>introduction</secondary>
  13.     </indexterm>
  14.     <para>A theme is a group of coordinated settings that specifies the visual
  15. appearance of a part of the GNOME Desktop. Users can choose themes to change
  16. the appearance of the GNOME Desktop.</para>
  17.     <para>A theme contains settings that affect different parts of the GNOME Desktop,
  18. as follows:</para>
  19.     <variablelist>
  20.       <varlistentry>
  21.         <term>Controls</term>
  22.         <listitem>
  23.           <para><indexterm><primary>themes</primary><secondary>controls options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>GTK+ themes</primary><see>themes, controls
  24. options</see></indexterm>The controls setting for a theme determines the visual
  25. appearance of windows, panels, and applets. The controls setting also determines
  26. the visual appearance of the GNOME-compliant interface items that appear on
  27. windows, panels, and applets, such as menus, icons, and buttons. Some of the
  28. controls setting options that are available are designed for special accessibility
  29. needs. Users can choose an option for the controls setting from the <guilabel>Controls</guilabel> tabbed section in the <application>Theme</application>
  30. preference tool.</para>
  31.         </listitem>
  32.       </varlistentry>
  33.       <varlistentry>
  34.         <term>Window frame</term>
  35.         <listitem>
  36.           <para><indexterm><primary>themes</primary><secondary>window frame options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>Metacity themes</primary><see>themes, window frame options</see></indexterm>The window frame setting for
  37. a theme determines the appearance of the frames around windows only. Users
  38. can choose an option for the window frame setting from the <guilabel>Window
  39. Border</guilabel> tabbed section in the <application>Theme</application> preference
  40. tool.</para>
  41.         </listitem>
  42.       </varlistentry>
  43.       <varlistentry>
  44.         <term>Icon</term>
  45.         <listitem>
  46.           <para><indexterm><primary>themes</primary><secondary>icons options</secondary><tertiary>introduction</tertiary></indexterm><indexterm><primary>icon themes</primary><see>themes, icons options</see></indexterm>The icon setting for a theme determines the appearance of
  47. the icons on panels and the desktop background. Users can choose an option
  48. for the icon setting from the <guilabel>Icons</guilabel> tabbed section in
  49. the <application>Theme</application> preference tool.</para>
  50.         </listitem>
  51.       </varlistentry>
  52.     </variablelist>
  53.   </sect1>
  54.   <sect1 id="themes-17">
  55.     <title>Theme Index File</title>
  56.     <para>Each theme has an index file which defines the characteristics of the
  57. theme. The name of the index file is <filename>/usr/share/themes/<replaceable>theme-name</replaceable>/index.theme</filename>. </para>
  58.     <para>The following is a sample theme index file:</para>
  59.     <programlisting>[Desktop Entry]
  60. Type=X-GNOME-Metatheme
  61. Name=High Contrast Large
  62. Name[es]=Alto contraste grande
  63. Comment=Large black-on-white text and icons
  64. Comment[es]=Textos e iconos grandes en negro sobre blanco
  65. Encoding=UTF-8
  66.  
  67. [X-GNOME-Metatheme]
  68. GtkTheme=HighContrastLargePrint
  69. IconTheme=HighContrast
  70. MetacityTheme=Atlanta
  71. ApplicationFont=sans 18
  72. </programlisting>
  73.     <para>The following table describes the keys in theme index files:</para>
  74.     <table frame="topbot" id="themes-TBL-18">
  75.       <title>Keys in Theme Index Files</title>
  76.       <tgroup cols="2" colsep="0" rowsep="0">
  77.         <colspec colname="colspec0" colwidth="33*"/>
  78.         <colspec colname="colspec1" colwidth="67*"/>
  79.         <thead>
  80.           <row rowsep="1">
  81.             <entry>
  82.               <para>Index File Key</para>
  83.             </entry>
  84.             <entry>
  85.               <para>Description</para>
  86.             </entry>
  87.           </row>
  88.         </thead>
  89.         <tbody>
  90.           <row>
  91.             <entry colname="colspec0" valign="top">
  92.               <para>
  93.                 <literal>Type</literal>
  94.               </para>
  95.             </entry>
  96.             <entry colname="colspec1" valign="top">
  97.               <para>Specifies that this theme determines
  98. the appearance of several theme options, such as controls, window frames,
  99. and icons.</para>
  100.             </entry>
  101.           </row>
  102.           <row>
  103.             <entry colname="colspec0" valign="top">
  104.               <para>
  105.                 <literal>Name</literal>
  106.               </para>
  107.             </entry>
  108.             <entry colname="colspec1" valign="top">
  109.               <para>The name of the theme. This is
  110. the name of the theme that is displayed in the <application>Theme</application>
  111. preference tool.</para>
  112.             </entry>
  113.           </row>
  114.           <row>
  115.             <entry colname="colspec0" valign="top">
  116.               <para>
  117.                 <literal>Comment</literal>
  118.               </para>
  119.             </entry>
  120.             <entry colname="colspec1" valign="top">
  121.               <para>A brief description of the theme.
  122. This is the text that is displayed under the name of the theme in the <application>Theme</application> preference tool.</para>
  123.             </entry>
  124.           </row>
  125.           <row>
  126.             <entry valign="top">
  127.               <para>
  128.                 <literal>GtkTheme</literal>
  129.               </para>
  130.             </entry>
  131.             <entry valign="top">
  132.               <para>Corresponds to the controls setting in the <application>Theme</application> preference tool. Specifies which controls setting option
  133. to apply to windows, panels, and applets.</para>
  134.             </entry>
  135.           </row>
  136.           <row>
  137.             <entry valign="top">
  138.               <para>
  139.                 <literal>IconTheme</literal>
  140.               </para>
  141.             </entry>
  142.             <entry valign="top">
  143.               <para>Corresponds to the icons setting in the <application>Theme</application> preference tool. Specifies which icons setting option
  144. to apply to panels and the desktop background.</para>
  145.             </entry>
  146.           </row>
  147.           <row>
  148.             <entry valign="top">
  149.               <para>
  150.                 <literal>MetacityTheme</literal>
  151.               </para>
  152.             </entry>
  153.             <entry valign="top">
  154.               <para>Corresponds to the window frame setting in the <application>Theme</application> preference tool. Specifies which window frame setting
  155. option to apply to windows.</para>
  156.             </entry>
  157.           </row>
  158.           <row>
  159.             <entry colname="colspec0" valign="top">
  160.               <para>
  161.                 <literal>ApplicationFont</literal>
  162.               </para>
  163.             </entry>
  164.             <entry colname="colspec1" valign="top">
  165.               <para>Corresponds to the application font setting in the <application>Font</application>
  166. preference tool.</para>
  167.             </entry>
  168.           </row>
  169.         </tbody>
  170.       </tgroup>
  171.     </table>
  172.   </sect1>
  173.   <sect1 id="themes-3">
  174.     <title>To Install a New Controls Option</title>
  175.     <indexterm>
  176.       <primary>themes</primary>
  177.       <secondary>controls options</secondary>
  178.       <tertiary>installing</tertiary>
  179.     </indexterm>
  180.     <para>You can add a new option
  181. for the controls setting in the <application>Theme</application> preference
  182. tool. Controls options reside in the <filename>/usr/share/themes</filename>
  183. directory. The typical structure of a controls option in the file system is
  184. as follows:</para>
  185.     <variablelist>
  186.       <varlistentry>
  187.         <term>Option file</term>
  188.         <listitem>
  189.           <para>
  190.             <filename>/usr/share/themes/<replaceable>option-name</replaceable>/gtk-2.0/gtkrc</filename>
  191.           </para>
  192.         </listitem>
  193.       </varlistentry>
  194.       <varlistentry>
  195.         <term>Image files</term>
  196.         <listitem>
  197.           <para>
  198.             <filename>/usr/share/themes/<replaceable>option-name</replaceable>/pixmaps/*.*</filename>
  199.           </para>
  200.         </listitem>
  201.       </varlistentry>
  202.     </variablelist>
  203.     <para>Typically, a new option for the controls setting is supplied
  204. as a <filename>.tar.gz</filename> file. To install the new controls option,
  205. unzip the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename> file into the <filename>/usr/share/themes</filename> directory.</para>
  206.     <para>Users can install their own options for the controls setting. If a user
  207. installs an option for the controls setting, the option is stored in the <filename>$HOME/.themes</filename> directory.</para>
  208.   </sect1>
  209.   <sect1 id="themes-5">
  210.     <title>To Install a New Window Frame Option</title>
  211.     <indexterm>
  212.       <primary>themes</primary>
  213.       <secondary>window frame options</secondary>
  214.       <tertiary>installing</tertiary>
  215.     </indexterm>
  216.     <para>You can add a new option
  217. for the window frame setting in the <application>Theme</application> preference
  218. tool. Window frame options reside in the <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1</filename> directory. The typical structure
  219. of a window frame option in the file system is as follows:</para>
  220.     <variablelist>
  221.       <varlistentry>
  222.         <term>Option file</term>
  223.         <listitem>
  224.           <para>
  225.             <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1/metacity-theme-1.xml</filename>
  226.           </para>
  227.         </listitem>
  228.       </varlistentry>
  229.       <varlistentry>
  230.         <term>Image files</term>
  231.         <listitem>
  232.           <para>
  233.             <filename>/usr/share/themes/<replaceable>option-name</replaceable>/metacity-1/*.*</filename>
  234.           </para>
  235.         </listitem>
  236.       </varlistentry>
  237.     </variablelist>
  238.     <para>Typically, a new option for the window frame setting
  239. is supplied as a <filename>.tar.gz</filename> file. To install the new window
  240. frame option, unzip the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename> file into the <filename>/usr/share/themes</filename> directory.</para>
  241.     <para>Users can install their own options for the window frame setting. If
  242. a user installs an option for the window frame setting, the option is stored
  243. in the <filename>$HOME/.themes</filename> directory.</para>
  244.   </sect1>
  245.   <sect1 id="themes-16">
  246.     <title>To Install a New Icons Option</title>
  247.     <indexterm>
  248.       <primary>themes</primary>
  249.       <secondary>icons options</secondary>
  250.       <tertiary>installing</tertiary>
  251.     </indexterm>
  252.     <para>You can add a new option for the icons
  253. setting in the <application>Theme</application> preference tool. Icons options
  254. reside in the <filename>/usr/share/icons/<replaceable>option-name</replaceable></filename>
  255. directory. The typical structure of an icons option in the file system is
  256. as follows:</para>
  257.     <variablelist>
  258.       <varlistentry>
  259.         <term>Option file</term>
  260.         <listitem>
  261.           <para>
  262.             <filename>/usr/share/icons/<replaceable>option-name</replaceable></filename>
  263.           </para>
  264.         </listitem>
  265.       </varlistentry>
  266.       <varlistentry>
  267.         <term>Image files</term>
  268.         <listitem>
  269.           <para>
  270.             <filename>/usr/share/icons/<replaceable>option-name</replaceable>/icons/*.*</filename>
  271.           </para>
  272.         </listitem>
  273.       </varlistentry>
  274.     </variablelist>
  275.     <para>Typically, a new option for the icons setting is supplied
  276. as a <filename>.tar.gz</filename> file. To install the new icons option, unzip
  277. the <filename>.tar.gz</filename> file, then untar the <filename>.tar</filename>
  278. file into the <filename>/usr/share/icons</filename> directory.</para>
  279.     <para>Users can install their own options for the icons setting. If a user
  280. installs an option for the icons setting, the option is stored in the <filename>$HOME/.icons/<replaceable>option-name</replaceable></filename> directory.</para>
  281.   </sect1>
  282.   <sect1 id="themes-11">
  283.     <title>Installing Icons for Themes</title>
  284.     <indexterm>
  285.       <primary>themes</primary>
  286.       <secondary>installing icons</secondary>
  287.     </indexterm>
  288.     <para>The GNOME Desktop provides several themes that are designed
  289. for users with special visual needs. For example, some of the themes are designed
  290. for users with low vision. Several versions of icons might be required so
  291. that the icon can be displayed properly in each theme.</para>
  292.     <para>You might need to install a new icon for an application. When you install
  293. a new icon, you must create several versions of the icon, so that the icon
  294. displays correctly in the themes. You must create several versions of the
  295. following types of icon:</para>
  296.     <itemizedlist>
  297.       <listitem>
  298.         <para>Icons that are used within applications in the GNOME Desktop.</para>
  299.       </listitem>
  300.       <listitem>
  301.         <para>Icons that are used internally by GTK+ applications, or GTK+
  302. stock icons.</para>
  303.       </listitem>
  304.     </itemizedlist>
  305.     <para>When you install a new icon, you must create several versions of the
  306. icon, so that the icon displays correctly in the themes. You can create the
  307. icons in several formats, for example Portable Network Graphic (PNG) format.
  308. The suggested size of icons for the desktop environment is 48 pixels by 48
  309. pixels. At this size, most themes can rescale the icons.</para>
  310.     <para>When you install a new icon, create the following 48 pixel by 48 pixel
  311. versions of the icon:</para>
  312.     <itemizedlist>
  313.       <listitem>
  314.         <para>Regular icon</para>
  315.       </listitem>
  316.       <listitem>
  317.         <para>Low contrast icon</para>
  318.       </listitem>
  319.       <listitem>
  320.         <para>High contrast icon</para>
  321.       </listitem>
  322.       <listitem>
  323.         <para>Inverse high contrast icon</para>
  324.       </listitem>
  325.     </itemizedlist>
  326.     <para>If possible, create 16 pixel by 16 pixel versions of the each of the
  327. icons above also, for themes that do not require large print.</para>
  328.     <para>Install the icons to the image files location that is specified for
  329. the theme in <xref linkend="themes-3"/> or <xref linkend="themes-5"/>. For example,
  330. to add icons to the HighContrastLargePrint theme, add the icons to the <filename>/usr/share/themes/HighContrastLargePrint/pixmaps</filename> directory. Add
  331. references to the icons to the relevant theme files. For example, to add icons
  332. to the HighContrastLargePrint theme, add references to the icons to the <filename>/usr/share/themes/HighContrastLargePrint/gtk-2.0/gtkrc</filename> file. Modify
  333. the <filename>gtkrc</filename> file for the theme to associate the icon with
  334. a GTK stock icon identifier.<!--More info required from Calum.--></para>
  335.     <para>For more information on how to create icons for application launchers
  336. and for panels, see <ulink url="http://www.freedesktop.org/Standards/icon-theme-spec">http://www.freedesktop.org/Standards/icon-theme-spec</ulink>.</para>
  337.   </sect1>
  338.   <sect1 id="themes-15">
  339.     <title>To Create a Custom Controls Option</title>
  340.     <indexterm>
  341.       <primary>themes</primary>
  342.       <secondary>controls options</secondary>
  343.       <tertiary>creating custom</tertiary>
  344.     </indexterm>
  345.     <para>If the options for the
  346. controls setting are not suitable for the needs of your users, you can create
  347. a custom controls option. To create a custom controls option, perform the
  348. following steps:</para>
  349.     <orderedlist>
  350.       <listitem>
  351.         <para>Create a directory structure for the option in the <filename>/usr/share/themes</filename> directory. Use the same directory structure that
  352. other options use. For example, to create an option that is called SmallPrint,
  353. create the following directories:</para>
  354.         <itemizedlist>
  355.           <listitem>
  356.             <para>
  357.               <filename>/usr/share/themes/SmallPrint</filename>
  358.             </para>
  359.           </listitem>
  360.           <listitem>
  361.             <para>
  362.               <filename>/usr/share/themes/SmallPrint/gtk-2.0</filename>
  363.             </para>
  364.           </listitem>
  365.         </itemizedlist>
  366.       </listitem>
  367.       <listitem>
  368.         <para>Locate the <filename>gtkrc</filename> file that is closest
  369. to meeting the needs of your users. Copy the file to the <filename>gtk-2.0</filename> directory of your new option.</para>
  370.       </listitem>
  371.       <listitem>
  372.         <para>Open the <filename>gtkrc</filename> file in a text editor,
  373.  and modify the attributes of the interface elements as required. </para>
  374.       </listitem>
  375.       <listitem>
  376.         <para>If the new option includes images, install the images for
  377. the new option in the <filename>pixmaps</filename> directory of your new option.
  378. If the new option uses images from another option, you do not need to create
  379. copies of the images for the new option. Instead, ensure that the reference
  380. to the images in the <literal>pixmap_path</literal> entry in the <filename>gtkrc</filename> file is correct.</para>
  381.       </listitem>
  382.     </orderedlist>
  383.     <para>Users can now choose the new option for the controls setting.</para>
  384.     <para>For more information on <filename>gtkrc</filename> files, see <ulink url="http://developer.gnome.org/doc/API/2.0/gtk/index.html">http://developer.gnome.org/doc/API/2.0/gtk/index.html</ulink>.</para>
  385.   </sect1>
  386. </chapter>
  387.